﻿// Decompiled with JetBrains decompiler
// Type: DnProcessSimulateCommands.TcCommands.CApAWCOpenStudyParameters
// Assembly: DnProcessSimulateCommands, Version=2402.0.0.890, Culture=neutral, PublicKeyToken=null
// MVID: A885D881-AEDF-447E-852A-6F13102E089C
// Assembly location: C:\Program Files\Tecnomatix_2402\eMPower\DotNetCommands\DnProcessSimulateCommands.dll

using ActiveWorkspaceHosting;
using Tecnomatix.Engineering;


namespace DnProcessSimulateCommands.TcCommands;

internal class CApAWCOpenStudyParameters
{
  private const string LINE_SIMULATION_IMPORT_MODE = "LineSimulation";
  private const string STANDARD_IMPORT_MODE = "Standard";

  public TxStudyLoadMode Mode { get; set; }

  public TxProcessModelId StudyContextUid { get; private set; }

  public TxProcessModelId CollabContextUid { get; private set; }

  public CApAWCOpenStudyParameters(TxHostLoadStudyMsg msg)
  {
    this.StudyContextUid = new TxProcessModelId(msg.StudyStructureContextUid);
    this.CollabContextUid = new TxProcessModelId(msg.CollaborationContextUid);
    this.Mode = this.GetImportModeFromParameter(msg.Mode);
  }

  private TxStudyLoadMode GetImportModeFromParameter(string loadingModeName)
  {
    TxStudyLoadMode modeFromParameter = (TxStudyLoadMode) 1;
    switch (loadingModeName)
    {
      case "LineSimulation":
        modeFromParameter = (TxStudyLoadMode) 2;
        break;
      case "Standard":
        modeFromParameter = (TxStudyLoadMode) 1;
        break;
    }
    return modeFromParameter;
  }
}
